package com.ruoyi.common.core.utils;

import cn.hutool.json.JSONUtil;

import java.util.List;

public class JsonUtils {
    public static String covertList2One(List<String> arr){
        return JSONUtil.toJsonStr(arr);
    }

    public static List<String> convertOne2List(String one){
        //return Arrays.asList(one.split(";")).stream().map(s->(s.trim())).collect(Collectors.toList());
        if(one == null || one.length() == 0){
            return null;
        }
        return JSONUtil.toList(JSONUtil.parseArray(one), String.class);
    }
}
